<?php

require_once 'classes/LightPressPlugin.php';

class HomePage extends LightPressPlugin {

    var $default_context = LP_CONTEXT_INDEX;
    var $active = true;
    var $hooks = array('shutdown');

    var $description = 'Replaces the index page with a specific static page.';
    var $constructor_args = array('home_page' => 'Page slug to use (does nothing if blank)');
    
    var $home_page = '';
    
    var $_frontend;

    function HomePage(&$frontend, $args, $dummy_run=false) {
		$this->LightPressPlugin($frontend, $args, $dummy_run);
        
        if(!$dummy_run && ($this->home_page != '')) {
            // change context to static if index was requested
            $frontend->context = $frontend->getContext('static', $this->home_page);
        }
    }
    
    function hide() {
        // do nothing
    }

    function run($hook, &$data) {
        // do nothing
	}
}

?>